-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue #506] Allow linking between series #587
base: main
Are you sure you want to change the base?
Conversation
23d8645
to
a5f0cac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delays getting this. I'll try to respond faster to future revisions. I have some minor nits in the docs but my bigger question is this: should this be a dedicated API, or could we allow this as part of a new update series API? For example:
PATCH /api/v1.4/series/1 HTTP/1.1
Content-Type: text/json
{
"related": [2, 3]
}
This is what we do for patches now, so I wonder if there's any reason not to do the same for series?
(fwiw, I have a clear preference for sticking to RESTful APIs where possible, so I'm wondering what reason, if any, there is for not doing things that way 🙂)
docs/api/rest/index.rst
Outdated
@@ -275,6 +275,7 @@ Supported Versions | |||
1.1, 2.1, ✓ | |||
1.2, 2.2, ✓ | |||
1.3, 3.1, ✓ | |||
1.4, 3.1, ✓ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.4, 3.1, ✓ | |
1.4, 3.2, ✓ |
docs/api/rest/schemas/v1.3.rst
Outdated
API v1.3 | ||
================= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API v1.3 | |
================= | |
API v1.3 | |
======== |
Also, we probably want to expose events for this? However, we should be careful not to avoid the pitfall encountered in related patches, namely that we returned the |
@stephenfin updated the API to follow your suggestion. My initial idea was to not require the user to just send the new values instead of appending them to the previous |
I have tried running this PR and accessing |
I'll investigate the issue that you mentioned |
Connecting this back to #506 "related_series" does not imply in any way that the connected series is an older or newer version. It would be better to make the contents of the related_series an [object in JSON speak|dict in Python speak] rather than a array of ints. |
Closes getpatchwork#506 Signed-off-by: andrepapoti <[email protected]>
For two series to be linked togheter they must belong to the same project Closes getpatchwork#506 Signed-off-by: andrepapoti <[email protected]>
…eries' Ensure the retrival of series is keept at O(1) complexity. Closes getpatchwork#506 Signed-off-by: andrepapoti <[email protected]>
Closes getpatchwork#506 Signed-off-by: andrepapoti <[email protected]>
Closes getpatchwork#506 Signed-off-by: andrepapoti <[email protected]>
Closes getpatchwork#506 Signed-off-by: andrepapoti <[email protected]>
@hero24 Just to confirm, you are getting this error when doing a PATCH request correct? At least for visualization I'm not getting any issues This error that you probably got is happening because you are using an user to authenticate that does not have a person associated with it. I've put the block inside a try/except block so you don't get an error on the interface anymore, you'll only get a "You do not have permission to perform this action." message instead. To go further on your test linking the series you'll either have to authenticate with an user that's linked to the series submitter or it's a superuser I've also modified so that superusers can link any series. Currently there is no interface for this feature since there's no proper series view, but I'm working on them (#589) and this functionality could be could be added to it after either of the PRs are merged. |
@kuba-moo Sorry, I don't know if I got your first point very well, do you believe 'related_series' to not be a descriptive enough name? |
At least 3 relationships come to mind immediately:
|
I got the error when I tried opening the API call in browser for series x, by default I believe it should return a JSON object with current series state, listing all the fields, but with this patch, when I tried it, it crashed the web page. |
Description
Allow linking between two series.
A new field called
related_series
was added to theSeries
model where you can reference otherSeries
. This feature is can be used to link different versions of the sameSeries
to easily build a version history.The linking of a
Series
is bidirectional so if you link A to B automatically B is linked to A.For this feature a new API endpoint was created so the API version was bumped to v1.4.
Related
Closes #506